package com.hsy.bibc.modules.common;

import android.os.Bundle;

import com.deparse.dpframe.ui.activity.DPBaseActivity;
import com.deparse.dpframe.utils.DPFileUtil;
import com.hsy.bibc.R;
import com.hsy.bibc.utils.CommonUtils;

import java.io.File;


/**
 * Created by hsy on 2016/3/23.
 */
public class CommonBaseActivity extends DPBaseActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getRootView().setBackgroundColor(getResources().getColor(R.color.app_background_color));
    }

//    @Override
//    protected void onResume() {
//        super.onResume();
//        JPushInterface.onResume(this);
//    }
//
//    @Override
//    protected void onPause() {
//        super.onPause();
//        JPushInterface.onPause(this);
//    }

    @Override
    protected void onStop() {
        super.onStop();
        CommonUtils.hideProgressDialog();
        System.gc();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        File cacheDir = new File(DPFileUtil.getCacheDir(this));
        if (cacheDir.exists() && cacheDir.isDirectory()) {
            DPFileUtil.emptyDir(cacheDir);
        }
    }
}
